/**
 * Created by qiaoshi on 2019/3/18.
 */
import React from 'react';

import render from '../../../../hrpub/common/frame/render';

import Action from '../actions/action';

import {createPage,base} from 'nc-lightapp-front';

const { NCLoading } = base;

import EmptyImg from '../../../../hrpub/common/components/emptyImg';

import Header from '../components/Header';

import Table from '../components/checkTable'

import { getAppPageConfig } from 'src/hrpub/common/utils/utils';

import './index.less';

const moduleId = "i6008"

const domainName = "hryf"

const Homepage =  render({
    
    actions: {
        action: Action
    },
    customData: '',
    state: {
        initDate:[],//页面初始化数据
        dateFlag:true, //数据状态
        buttonFlag:true, //按钮显隐状态
        areacode:'', //表格区域编码
        place:'1', //人员下拉选项
        selectCount:'0',//选中数据数量
        defaultDate:{}, //默认选中数据
        refpk:null,//人力资源组织
        json:{},
        show:false,
        buttonDisableFlag:false,
        pageHeight:'450px',
        orgValue:{} //人力资源组织
    }
})(({props, action, state}, {customData}) => {
    
    return (
        <div className="salaryAuthority nc-bill-card">
            <Header 
                { ...props}
                action = {action.action}
                initDate = {state.initDate}
                areacode = {state.areacode}
                buttonFlag = {state.buttonFlag}
                buttonDisableFlag = {state.buttonDisableFlag}
                place = {state.place}
                dateFlag = {state.dateFlag}
                ref = "buttonTool"
                json = {state.json}
                orgValue = {state.orgValue}
                selectCount = {state.selectCount}
            />
            <div className="enpty">
                {state.dateFlag===true?
                <Table 
                    {...props} 
                    height = {state.pageHeight}
                    afterEventFn = {action.action.afterEventFn}
                    clickHandle = {action.action.clickHandle}
                    areacode = {state.areacode}
                    place = {state.place}
                />:<EmptyImg text = {state.json['gx6008-000022']} />}
            </div>
             <NCLoading
                    container={this}
                    show={state.show} >
            </NCLoading>

        </div>
    )
});

export default Homepage
// export default createPage({
//      billinfo: [
//     {
//         billtype: 'grid',
//         pagecode: getAppPageConfig().appcode,
//         bodycode: 'reg_item_list'
//     }]
// })(Homepage)